<?php
namespace app\admin\controller;

#@友情链接管理@#
class Link extends Common{

    public $modelName = 'LinkList';
    

    protected function initialize(){
   
    }

    #数据列表#
    public function lists(){
   
        if($this->request->isGet()){

            if($this->request->isAjax()){
            
                return $this->_model('LinkList')->_getPage();
             
            }
            
            return $this->fetch();

        }

    }

    #添加数据#
    public function add(){
        
        if($this->request->isGet()){

            return $this->fetch();

        }else{

            $this->_model('LinkList')->_add();  

        }
    }
    
    #修改数据#
    public function edit(){
   
        if($this->request->isGet()){

            if($this->request->isAjax()){

                return  $this->_model('LinkList')->_get();

            }

            return $this->fetch();

        }else if($this->request->isPut()){ 

            $this->_model('LinkList')->_update();
        }
    }

    #删除数据#
    public function del(){

        if($this->request->isDelete()){
          
          $this->_model('LinkList')->_del();

        }
    }

    #修改状态#
    public function up(){

        if($this->request->isPut()){

            $this->_model('LinkList')->_update();

        }
    }



}
